/**
 * 
 */
package com.planner.core.action.node;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.beans.factory.annotation.Required;

import com.india.StopNode;
import com.planner.core.action.node.form.ManageNodesForm;
import com.planner.core.cache.NodeCacheManager;

/**
 * @author Sangharsh
 *
 */
public class ManageNodesAction extends AbstractNodeAction {
	
	private static final Log LOG = LogFactory.getLog(ManageNodesAction.class);
	
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		ManageNodesForm manageNodesForm = (ManageNodesForm)form;
		LOG.info("Executing Action ManageNodesAction");
		List<StopNode> nodes = stopService.getAllNodes();
		manageNodesForm.setNodes(nodes);
		return mapping.findForward(SUCCESS_FORWARD);
	}

	@Required
	public void setNodeCacheManager(NodeCacheManager nodeCacheManager) {
		this.nodeCacheManager = nodeCacheManager;
	}
	
}
